package com.creative.accountsdk.widget;
import android.content.Context;  
import android.graphics.Canvas;  
import android.graphics.Color;  
import android.graphics.Paint;  
import android.util.AttributeSet;  
import android.widget.EditText;

/**
 * 去除EditText边框，添加下划线，
 */
public class LineEditText extends EditText {  
  
    private Paint mPaint;  
    /** 
     * @param context 
     * @param attrs 
     */  
    public LineEditText(Context context, AttributeSet attrs) {  
        super(context, attrs);
        mPaint = new Paint();  
          
        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setColor(Color.rgb(230,230,230));
    }  
      
    @Override  
    public void onDraw(Canvas canvas)  
    {  
        super.onDraw(canvas);  

        // 得到每行的高度
        int lineHeight = getLineHeight()+5;
        canvas.drawLine(0, lineHeight, this.getWidth(), lineHeight, mPaint);
    }  
} 